package com.thinvent.recommend.manager.parser;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 简化后的 ParserFactory：不再区分后缀，全部使用 TikaDocumentParser
 */
@Component
public class ParserFactory {

    private final DocumentParser parser;

    public ParserFactory(TikaDocumentParser tikaParser) {
        this.parser = tikaParser;
    }

    /**
     * 无论传入什么 extension，都返回同一个 TikaDocumentParser
     */
    public DocumentParser getParser(String extension) {
        return parser;
    }
}
